package wotd;

import java.io.IOException;

/**
 * Retrieves a passage.
 * 
 * @author anthony
 */
public interface VerseLookup {
	/**
	 * Spools a series of verses one at a time.
	 */
	public interface VerseSpooler {
		/**
		 * Invoked when the next verse is available.
		 * @param next the next verse
		 */
		public void spool(String next);
	}
	
	/**
	 * Returns a verse selected at random.
	 * @return the passage
	 * @throws IOException unable to lookup verse
	 */
	String getRandomVerse() throws IOException;

	/**
	 * Returns the selected verse.
	 * @param reference the excerpt reference
	 * @return the verse
	 * @throws IOException unable to lookup verses
	 */
	String getSelectedVerse(String reference) throws IOException;

	/**
	 * Retrieves all available verses.
	 * @param spooler the spooler
	 * @throws IOException unable to retrieve verses
	 */
	void getAllVerses(VerseSpooler spooler) throws IOException;

}